home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / password.arc / password.src < prev   
Internet Message Format  |  1988-08-22  |  5KB

  1. From lean@sbcs.sunysb.edu (Lean L. Loh) Sun Jul 24 01:08:00 1988
  2. Path: caen.engin.umich.edu!mailrus!ames!amdahl!pyramid!prls!philabs!sbcs!lean
  3. From: lean@sbcs.sunysb.edu (Lean L. Loh)
  4. Newsgroups: comp.sys.atari.st
  5. Subject: password program/source
  6. Keywords: password, protection, login
  7. Message-ID: <1413@sbcs.sunysb.edu>
  8. Date: 24 Jul 88 05:08 GMT
  9. Organization: State University of New York at Stony Brook
  10. Lines: 139
  11.  
  12.  
  13. Here's a little program which i put in my HD auto folder.  All it does is
  14. prompt the user for a loginame and password.  The loginame is not used at
  15. all. Only the password is used for verification.  The program will not
  16. terminate until the correct password is entered.  Hence, one can use it to
  17. prevent unauthorized access to one's ST.  Of course, one can always boot
  18. from the floppy drive.
  19.  
  20. Both source code and executables are included. As one can see, i've set up
  21. two passwords:  a) atari!   b) guest!
  22. One can use a HEX editor to re-edit those two passwords in the executables.
  23. The two passwords can be found at the end of line 19 and at beginning of
  24. line 20 of the executables.  The source code could be better, but .....
  25. Also, I'm posting it here since it's so small.  :-)
  26.  
  27.  
  28. /*   Use at your own risk.  Author/poster will not be responsible in any
  29.      way for any consequence of using this program.
  30. */
  31.  
  32. #include <osbind.h>
  33. #define passwd1 "atari!"        /*  your password  */
  34. #define passwd2 "guest!"        /*  for your guests? */
  35. #define       LINEFEED    10
  36. #define       RETURN      13
  37. #define       TRUE     1
  38. #define          FALSE      0
  39. #define       MAX    16        /*  max length for password  */
  40. main()
  41. {
  42. char word[MAX];
  43.                
  44.     Cconws("\33E\33e\r\n");       /* clear screen, enable cursor, skipline */
  45.     do
  46.     {
  47.       Cconws( "login: " );
  48.       getword( word, TRUE );
  49.       Cconws( "Password: ");
  50.       getword( word, FALSE );
  51.       if ( strcmp( word, passwd1 ) == 0 )
  52.             exit(0);
  53.       else
  54.         if ( strcmp( word, passwd2 ) == 0 )
  55.             exit( 0 );
  56.         else
  57.             {
  58.             Cconws("Login incorrect\n\r");
  59.             Cconout(7);        /* ring bell */
  60.             }
  61.     }  while (TRUE);
  62. }
  63.     
  64. getword( str, echo )
  65. char *str;
  66. int echo;
  67. {
  68. char ch;
  69. int i;
  70. long int lret;
  71.  
  72.   i = 0; 
  73.   do
  74.   {
  75.     if ( Cconis() != 0 )        /* keyboard char available  */
  76.         {
  77.          lret = Crawcin();        /* get raw char from keyboard */
  78.              ch = lret & 0x00ff;    /* Mask off everything but the low byte */
  79.          if (echo)
  80.          Cconout( ch );        /* echo if requested */
  81.  
  82.          if ( ch !=  RETURN )
  83.          {
  84.                 if (i < MAX)
  85.             {
  86.                 str[i] = ch;
  87.                 i++;
  88.             }
  89.          }
  90.          else
  91.             str[i] = '\0';
  92.      }
  93.    } while ( ch != RETURN );
  94.  
  95.    Cconout( LINEFEED );
  96.    Cconout( RETURN );
  97. }
  98.  
  99. ==============================
  100. table
  101.  !"#$%&'()*+,-./0123456789:;<=>?
  102. @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
  103. begin 644 forpost.prg
  104. M8!H   1F    @                        "IO  0@;0 8T>T '"1M "Q"z
  105. M@")(2A)G4"**)DHD64H:9OPBBDH29SP,&P!!9NP,&P!29N8,&P!'9N ,&P!6y
  106. M9MH,&P ]9@I*$V<&(\L   2^0ID@"2**)DHD64H:9OPBBDH29O(F &8R0ID@x
  107. M"2+\   $X$7M ( 4&DB"0C(@ '(@%!IG%K0!9_A32B+*%!IG"K0!9OA"*O__w
  108. M8.9"F2()T_D   3B(\$   3B+DDK20 $+PTCR   !( O""\ DH#D@5-!/P&3v
  109. MS2\)+PU"9S\\ $I.0=[\  Q*@V8N/SP !#\\  ).N0   JH^@$ZY   "^#]\u
  110. M  (  D)73KD   *J/H!.N0   OA83YS.3KD   $BWOP "C\ 3KD   )T/SP t
  111. M3$Y!3E;_\"\\   $A' )/P!.05Q/+SP   2+< D_ $Y!7$]P 3\ 2&[_\$ZYs
  112. M   !R%Q/+SP   23< D_ $Y!7$]"9TAN__!.N0   <A<3R\\   $GDAN__!.r
  113. MN0   EQ03TI 9@Q"9TZY   "=%1/8*0O/   !*5(;O_P3KD   )<4$]*0&?>q
  114. M+SP   2L< D_ $Y!7$]P!S\ < (_ $Y!6$]@ /]R3EY.=4Y6__A";O_\< L_p
  115. M $Y!5$]*@&=<< <_ $Y!5$\M0/_X("[_^ *     _QU __Y*;@ ,9Q 0+O_^o
  116. M2( _ ' "/P!.05A/#"X #?_^9QH,;@ 0__QL'#!N__S1[@ ($*[__E)N__Q@n
  117. M"C!N__S1[@ (0A ,+@ -__YFD' */P!P C\ 3D%83W -/P!P C\ 3D%83TY>m
  118. M3G4B;P $(&\ "! 9D!!F!$H89O9(@$C 3G5.5@  3KD   *./RX "$ZY   "l
  119. MEE1/3EY.=4Y6  !.7DYU3E8  #\N  AP3#\ 3D%83TY>3G5.5O_\+P<_+@ (k
  120. M<$4_ $Y!6$\^ &P0, =(P"\ 3KD   1$6$]@(C\N  A.N0   U!43SU   AMj
  121. M#C\N  @_!TZY   #J%A/, <N'TY>3G5.5O_\+P<_+@ (/RX "G)&/P%.05Q/i
  122. M/@!*0&8H/RX "$ZY   #4%1//4  "&T6/RX "#\N  I.N0   ZA83S N  I@h
  123. M#C '2, O $ZY   $1%A/+A].7DYU3E;_^$C7(( ^+@ (, =60 Q   )B'.5(g
  124. M,$#1_   !&8@4$[08"IP4& F<$%@(G!#8!Y*1VT.*GD   2^4T=M"$H=9OAPf
  125. M_V (2A5G^! 52(!,UR" 3EY.=4Y6__A(UR" /BX "$I';0XJ>0  !+Y31VT(e
  126. M2AUF^'#_8 I*%6?X,"X "AJ 3-<@@$Y>3G5.5O_X2-<@@#XN  @P!U9 #$  d
  127. M F)(Y4@P0-'\   $<B!03M J>0  !+X0%4B L$=G#$H59@1PW6 F4HU@[" -c
  128. MD+D   2^/P!.N0   JI43V .?D-@SGY!8,I^4&#&<-M,UR" 3EY.=4Y6  !*b
  129. MK@ (;! @+@ (1( SP   !'YP_V $("X "$Y>3G4   -V   #>@   WX   0Va
  130. M   $,@  !"X        ;11ME#0H ;&]G:6XZ( !087-S=V]R9#H@ &%T87)Iz
  131. M(0!G=65S="$ 3&]G:6X@:6YC;W)R96-T"@T    $PD-#05 _/S\_/S\_/S\_y
  132. M/S\_/S\_/S\_/S\_/S\        (     $PB,@8., @." H,$ X6"!0("@X*x
  133. M"@S2"D0.%# 6%"@<,CX*' @P$ 0$! 0$1  ' 1 !"@ P    9@0         w
  134. M    &    &@              (P!          !M86EN7P              v
  135. M$    "(!97)R;F]?             !0   !^!%]S=&MS:7IE7P         4u
  136. M    X@1?9V5T9FAT>7!E7P      $    % #7V-M9&YA;65?         !0 t
  137. M  #@!%]A;&EA<V9H7P         0    W -E>&ET7P              $   s
  138. M '0"7W-E=&9H='EP95\      !    "H V1U<#)?               0    r
  139. M^ )G971W;W)D7P          $    ,@!96YV:7)O;E\          !0   " q
  140. M!&1U<%\                0    J@)?:6]V96-T;W)?        %    +X$p
  141. M7W-T87)T7P           !       %]S971E<G)N;U\        0    1 1?o
  142. M97AI=%\             $    )8"<W1R8VUP7P           !    !< E]Fn
  143. 4:6YI<VA?           0    C@("m
  144.  l
  145. end
  146.  
  147. -- 
  148. if you can dream it, you can do it.               CSNET:lean@sbcs.csnet
  149. ... go sleep                  ARPA:lean%suny-sb.csnet@csnet-relay.arpa
  150.                   UUCP:{allegra, hocsd, philabs, ogcvax}!sbcs!lean
  151.  
  152.  
  153.